package com.qfedu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qfedu.entity.MessageEntity;
import com.qfedu.service.TicklingService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class TicklingController {


    @Reference(check = false)
    TicklingService ticklingService;

    @RequestMapping("/insertMessage")
    @ResponseBody
    public String insertMessage(MessageEntity me){

        if (me.getLname() == null || me.getLname() == ""){
            return "1111";
        }
        if (me.getLradio() == null || me.getLradio() == ""){
            return "2222";
        }
        if (me.getLcontent() == null || me.getLcontent() == ""){
            return "3333";
        }
        if (me.getLphone() == null || me.getLphone() == ""){
            return "4444";
        }
        boolean b = ticklingService.addliuyan(me);
        if (b){
            return "0000";
        }
        return "";
    }

    @RequestMapping("/jumpTick")
    public String jumpTick(){

        return "tickling";
    }

    @RequestMapping("/jumpZou")
    public String jumpZou(HttpServletRequest request){

        return "zoujin";
    }


    @RequestMapping("/jumpLianxi")
    public String jumpLianxi(HttpServletRequest request){

        return "lianxi";
    }
    @RequestMapping("/jumpHangxian")
    public String jumpHangxian(){

        return "hangxian";
    }
    @RequestMapping("/jumpMap")
    public String jumpMap(){

        return "hxmapper";
    }
    @RequestMapping("/jumpboot")
    public String jumpboot(){

        return "boottype";
    }
    @RequestMapping("/jumpsoat")
    public String jumpsoat(){

        return "soattype";
    }
    @RequestMapping("/jumpprice")
    public String jumpprice(){

        return "price";
    }
}
